﻿using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;

namespace Bookvar.ObjectModel
{
    [DataContract]
    [Serializable]
    public class CustomProperty
    {
        [DataMember( Name = "Key")]
        private readonly string key;
        private object value;

        #region Properties

        public string Key
        {
            get { return key; }
        }

        [SuppressMessage("Microsoft.Maintainability", "CA1500:VariableNamesShouldNotMatchFieldNames", MessageId = "value")]
        [DataMember]
        public object Value
        {
            get { return value; }
            set { this.value = value; }
        }

        #endregion

        public CustomProperty( string key )
        {
            this.key = key;
        }

        public CustomProperty( string key, object value ) : this( key )
        {
            this.value = value;
        }
    }
}
